fix(prism): load prismjs core before language components#5262
Conversation
prismjs language components (prismjs/components/prism-*) register on the global Prism that core installs; importing a component before core throws 'Prism is not defined' (in SSR and the client). The @sim/emcn extraction changed bundling so core no longer loaded eagerly first, exposing the latent bad order on the home (chat-content) and workflow-editor pages. - chat-content.tsx: import prismjs core first (it needs ts/bash/css/markup, which emcn does not register). - code-editor.tsx, input-format.tsx, code.tsx: drop the redundant prism-json/prism-python imports — these highlight via emcn's languages, which already registers js/json/python in the correct order.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 420b475. Configure here. |
Greptile SummaryThis PR fixes Prism loading for chat and editor highlighting. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(prism): load prismjs core before lan..." | Re-trigger Greptile |
Summary
Fixes
Prism is not definedon the home (Chat) and workflow-editor pages after the@sim/emcnextraction.prismjs language components (
prismjs/components/prism-*) register on the globalPrismthat prismjs core installs. Importing a component before core throwsPrism is not defined— in SSR and the client. The extraction changed bundling so core no longer loaded eagerly first, exposing a latent bad import order.chat-content.tsx: import prismjs core first (it needs ts/bash/css/markup, which emcn does not register).code-editor.tsx,input-format.tsx,code.tsx: drop the redundantprism-json/prism-pythonimports — these highlight via emcn'slanguages, which already registers js/json/python in the correct order.Follow-up to #5261 (the
sideEffectschange was necessary but not sufficient — the real cause was import order).Type of Change
Testing
Prism is not definedis gone on Chat, Logs, and the workflow editor.Checklist